package com.jsx.hyyscript;

import com.alibaba.fastjson.JSON;
import com.jsx.hyyscript.common.util.HttpsUtils;
import com.jsx.hyyscript.module.importsystask.entity.LoginPo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;

/**
 * @author jxygzzy
 */
@SpringBootApplication
public class HyyScriptApplication {

    public static void main(String[] args) {
        String login = login();
        while (null == login) {
            login = login();
        }
        SpringApplication.run(HyyScriptApplication.class, args);
    }

    public static String login() {
        LoginPo loginPo = new LoginPo();
        loginPo.setUsername("ZZT");
        loginPo.setPassword("123456");
        loginPo.setVerificationCode("666666");
        try {
            return HttpsUtils.post("http://localhost:8082/web/manager/login", JSON.toJSONString(loginPo));
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("登录失败");
        }
        return null;
    }
}
